package Lesson;

public class Class0812 {
    public static void print(int row,int col,String str){
        for (int i=0;i<row;i++){
            for (int j=0;j<col;j++){
                System.out.print(str);
            }
            System.out.println();
        }
    }

    //打印3--100之间所有的质数
    public static void singleNum(){
        for(int i=3;i<=100;i++){
            boolean flag=true;
            for(int j=2;j<i;j++){
                if(i%j==0){
                    flag=false;
                    break;
                }
            }
            if(flag){
                System.out.print(i+" ");
            }
        }
        System.out.println();
    }

    //方法二（打印3--100的所有质数）
    public static boolean isLeap(int n){
        for (int i=2;i<n;i++){
            if(n%i==0){
                return false;
            }
        }
        return true;
    }




















    public static void main(String[] args) {
        print(3,5,"*");
        print(2,6,"#");
        print(3,5,"*");
        print(2,3,"%");
        singleNum();
        for (int i=3;i<=100;i+=2){
            boolean flag=isLeap(i);
            if(flag){
                System.out.print(i+" ");
            }
        }


    }

}
